package com.herr.annotation;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

//默认为@Component(value="personDao")，相当于<bean id="" class="">
@Component(value = "personDao123")
//默认为@Scope(value = "singleton")，为单例时，如同时实例化两个对象，两个对象地址一致。
//@Scope(value = "prototype")
public class PersonDao {
    public int a=1;
    public void printName(){
        System.out.println("herr");
    }

    public void initPersonDao(){
        System.out.println("initPersonDao callback");
    }

}
